repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v4.4.0
    hooks:
      - id: trailing-whitespace
      - id: end-of-file-fixer
      - id: check-docstring-first
      - id: check-xml
      - id: check-json
      - id: check-yaml
      - id: check-toml
      - id: debug-statements
      - id: check-executables-have-shebangs
      - id: check-case-conflict
      - id: check-added-large-files
      - id: detect-private-key
  # Formatter for Json and Yaml files
  - repo: https://github.com/pre-commit/mirrors-prettier
    rev: v3.0.0-alpha.9-for-vscode
    hooks:
      - id: prettier
        types: [json, yaml, toml]
  # Formatter for markdown files
  - repo: https://github.com/executablebooks/mdformat
    rev: 0.7.16
    hooks:
      - id: mdformat
        args: ["--number"]
        additional_dependencies:
          - mdformat-gfm
          - mdformat-tables
          - mdformat-frontmatter
          - mdformat-black
          - mdformat-shfmt
  # An extremely fast Python linter, written in Rust
  - repo: https://github.com/charliermarsh/ruff-pre-commit
    rev: "v0.0.263"
    hooks:
      - id: ruff
        args: [--fix, --exit-non-zero-on-fix]
  # Python code formatter
  - repo: https://github.com/psf/black
    rev: 23.3.0
    hooks:
      - id: black
        args: ["--config", "pyproject.toml"]
  # Python's import formatter
  - repo: https://github.com/PyCQA/isort
    rev: 5.12.0
    hooks:
      - id: isort
  # Formats docstrings to follow PEP 257
  - repo: https://github.com/PyCQA/docformatter
    rev: v1.6.4
    hooks:
      - id: docformatter
        additional_dependencies: [tomli]
        args: ["--in-place", "--config", "pyproject.toml"]
